<template>
  <div>
     <i @click="$router.back()">返回</i>
    <el-card
      shadow="always"
      v-for="item in arrlist"
      :key="item.id"
      style="margin: 15px; height: 150px"
      @click.native="additem(item.id)"
    >
      地产列表
      <el-row type="flex" style="height: 100%">
        <el-col :span="8">
          <el-row
            type="flex"
            justify="center"
            style="height: 100%"
            class="leftitem"
          >
            <img :src="item.image" alt="" style="height: 100px" />
          </el-row>
        </el-col>
        <el-col :span="16">
          <el-row type="flex" justify="center" style="height: 100%">
            <el-row type="flex" class="item">
              <el-row type="flex" justify="center">
                <h1 style="margin: 5px 0 10px 0">{{ item.title }}</h1>
              </el-row>
              <el-col>{{ item.desc }}</el-col>
            </el-row>
          </el-row>
        </el-col>
      </el-row>
    </el-card>
  </div>
</template>


<script>
import { getproperties } from "@/api/agents";
export default {
  data() {
    return {
      arrlist: [],
    };
  },
  created() {
    this.getlist();
  },
  methods: {
    async getlist() {
      // const id=  this.$route.query.id
      //  console.log(this.$route.query);
      const res = this.$route.query;
      const { data } = await getproperties(res);
      console.log(data);
      this.arrlist = data;
    },
  },
};
</script>


<style leng='scss' scoped>
.item {
  flex-direction: column;
}
.leftitem {
  border-right: 1px solid #999;
}
.el-row--flex {
  display: flex;
  margin: 10px;
}
</style>